package main

import "fmt"

//常量声明
const pi = 3.1415
const e2 = 2.7182

//声明多个常量
const (
	pi1 = 3.1415
	e1 = 2.7182
)
//声明多个常量时，如果省略了值则表示和上面一行的值相同
const (
	n1 = 100
	n2
	n3
)
/**
	iota
	iota是go的常量计数器，只能在常量表达式中使用
	iota在const关键字出现时将重置为0。const中每新增一行常量声明将使iota计数一次
 */
const (
	m1 = iota
	m2
	_ //跳过这个值
	m4
)
const (
	a1 = iota	//0
	a2 = 100	//100
	a3 = iota	//2
	a4			//3
)

const (
	q, w = iota + 1, iota + 2	//1, 2
	e, r 						//2, 3
	t, y						//3, 4
)

func main()  {
	fmt.Println(n1)
	fmt.Println(n2)
	fmt.Println(n3)
	fmt.Println(m1)
	fmt.Println(m2)
	fmt.Println(m4)
	fmt.Println(a1)
	fmt.Println(a2)
	fmt.Println(a3)
	fmt.Println(a4)
	fmt.Println(e)
}
